<html>
  <head>
    <title>
    </title>
	<script src="http://code.jquery.com/jquery-latest.js"></script>
  </head>
  <body>
<?php
require_once '../conf/DbConnector.php';

$db=mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME)
		or die('<p><font color=red>Fehler bei der Datenbankverbindung: '.
		mysqli_connect_errno().': '.mysqli_connect_error().'</p>');	
?>
      
      <form method="post" action="../sql/addBook.php" enctype="multipart/form-data">
          <div>
              <table>
              <tr>
                  <td><label for="name">Book Name: </label></td>
                  <td><input name="name" id="name" type="text"></td>
              </tr>
              <tr>
                  <td><label for="volume">Book Volume:</label></td>
                  <td><input type="number" name="volume" id="volume" min="0" max="30"></td>
              </tr>
              <tr>
                  <td><label for="series">Series: </label></td>
              <td>
                  <select id="series" name="series">
                  <?php
                  
                  $sql="SELECT Series.Ser_ID, Series.Ser_Name
                        FROM Series
                        ORDER BY Series.Ser_Name";
                  
                  $result = mysqli_query($db, $sql); while ($zeile=mysqli_fetch_array($result)){ ?>
                  <option value="<?php echo $zeile['Ser_ID']; ?>"><?php echo $zeile['Ser_Name']; ?></option>
                  <?php } ?>
                  </select>
              </td>
              </tr>
              <tr>
                  <td><label for="file">Filename:</label></td>
                  <td><input type="file" name="file" id="file" /></td>
              </tr>
              <tr>
                  <td></td>
                  <td><input type="submit" name="submit" value="Add"></td>
              </tr>
              </table>
          </div>
      </form>
  </body>
<?php mysqli_close($db); ?>
</html>